package com.im.partchat.utils;

import android.app.Activity;
import android.content.Intent;

import com.im.partchat.bean.learn.Tab4New;
import com.im.partchat.ui.activity.ContactActivity;
import com.im.partchat.ui.activity.DocDownloadActivity;
import com.im.partchat.ui.activity.GroupActivtiy;
import com.im.partchat.ui.activity.LocationActivity;
import com.im.partchat.ui.activity.LoginActivity;
import com.im.partchat.ui.activity.MainActivity;
import com.im.partchat.ui.activity.PersonActivity;
import com.im.partchat.ui.activity.SelectFriendsActivity;
import com.im.partchat.ui.activity.VideoDetailActivity;
import com.im.partchat.ui.activity.conversation.SingleSettingActivity;
import com.im.partchat.ui.activity.more.ChangePasswordActivity;
import com.im.partchat.ui.activity.more.MyFootActivity;
import com.im.partchat.ui.activity.more.MyNoteActivity;
import com.im.partchat.ui.activity.more.MyPartActivity;
import com.im.partchat.ui.activity.more.PayDuesActivity;
import com.im.partchat.ui.activity.more.PayDuesWebViewActivity;
import com.im.partchat.ui.activity.more.SettingActivity;

import io.rong.imlib.model.Conversation;

/**
 * Created by fzl on 2017/4/7.
 * VersionCode: 1
 * Desc:
 */

public class Navigation {
    public static final String CONVERSATIONTYPE = "conversationType";
    public static final String TARGETID = "TargetId";
    public static final String BEANMOVIE = "BEANMOVIE";
    public static final String TITLE = "title";
    public static final String URL = "url";


    public static void navigateMain() {
        Activity currentActivity = getCurrentActivity();
        Intent intent = new Intent(currentActivity, MainActivity.class);
        currentActivity.startActivity(intent);

    }
    public static void navigateLogin() {
        Activity currentActivity = getCurrentActivity();
        Intent intent = new Intent(currentActivity, LoginActivity.class);
        currentActivity.startActivity(intent);

    }
    public static void navigateChangePassword() {
        Activity currentActivity = getCurrentActivity();
        Intent intent = new Intent(currentActivity, ChangePasswordActivity.class);
        currentActivity.startActivity(intent);

    }
    public static void navigateSingleSetting(String TargetId, Conversation.ConversationType type) {
        Activity currentActivity = getCurrentActivity();
        Intent intent = new Intent(currentActivity, SingleSettingActivity.class);
        intent.putExtra(TARGETID,TargetId);
        intent.putExtra(CONVERSATIONTYPE,type);
        currentActivity.startActivity(intent);

    }

    public static void navigateLocation() {
        Activity currentActivity = getCurrentActivity();
        Intent intent = new Intent(currentActivity, LocationActivity.class);
        currentActivity.startActivity(intent);

    }
    public static void navigateVideoDetail(Tab4New tab4New) {
        Activity currentActivity = getCurrentActivity();
        Intent intent = new Intent(currentActivity, VideoDetailActivity.class);
        intent.putExtra(BEANMOVIE, tab4New);
        currentActivity.startActivity(intent);

    }
    public static void navigateMyFoot() {
        Activity currentActivity = getCurrentActivity();
        Intent intent = new Intent(currentActivity, MyFootActivity.class);
        currentActivity.startActivity(intent);

    }


    public static void navigateMyPart() {
        Activity currentActivity = getCurrentActivity();
        Intent intent = new Intent(currentActivity, MyPartActivity.class);
        currentActivity.startActivity(intent);

    }
    public static void navigateDocDownLoad() {
        Activity currentActivity = getCurrentActivity();
        Intent intent = new Intent(currentActivity, DocDownloadActivity.class);
        currentActivity.startActivity(intent);

    }
    public static void navigateMyNote() {
        Activity currentActivity = getCurrentActivity();
        Intent intent = new Intent(currentActivity, MyNoteActivity.class);
        currentActivity.startActivity(intent);

    }
    public static void navigatePayDues() {
        Activity currentActivity = getCurrentActivity();
        Intent intent = new Intent(currentActivity, PayDuesActivity.class);
        currentActivity.startActivity(intent);

    }

    public static void navigateWebview(String title, String url) {
        Activity currentActivity = getCurrentActivity();
        Intent intent = new Intent(currentActivity, PayDuesWebViewActivity.class);
        intent.putExtra(URL,url);
        intent.putExtra(TITLE,title);
        currentActivity.startActivity(intent);

    }
    public static void navigateSetting() {
        Activity currentActivity = getCurrentActivity();
        Intent intent = new Intent(currentActivity, SettingActivity.class);
        currentActivity.startActivity(intent);

    }


    public static void navigateContact() {
        Activity currentActivity = getCurrentActivity();
        Intent intent = new Intent(currentActivity, ContactActivity.class);
        currentActivity.startActivity(intent);

    }

    public static void navigatePerson(String userId) {
        Activity currentActivity = getCurrentActivity();
        PersonActivity.startPersonActivity(currentActivity, userId);
    }

    public static void navigateGroup() {
        Activity currentActivity = getCurrentActivity();
        Intent intent = new Intent(currentActivity, GroupActivtiy.class);
        currentActivity.startActivity(intent);
    }

    public static void navigateSelectFriends() {
        Activity currentActivity = getCurrentActivity();
        Intent intent = new Intent(currentActivity, SelectFriendsActivity.class);
        currentActivity.startActivity(intent);
    }

    public static Activity getCurrentActivity() {
        return AppManager.getAppManager().currentActivity();
    }
}
